package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ulwx.database.DbException;
import com.ulwx.tool.DbUtils;
import feeinterface.modeldb.BaseGetPhoneFromWap;
/**
 * 
 * @author 黄杰
 * 
 */
public class BaseGetPhoneFromWapDao {

	/**
	 * 随机获取一条记录
	 * @return
	 * @throws DbException
	 */
	public static BaseGetPhoneFromWap getPhoneFromWap() throws Exception {
		StringBuffer sb = new StringBuffer();
		sb.append("SELECT * FROM BaseGetPhoneFromWap ORDER BY RAND() LIMIT 1");
		Map<Integer, Object> args = new HashMap<Integer, Object>();
//		DataBase db = DataBaseFactory.getDataBase();
		List<BaseGetPhoneFromWap> list = DbUtils.doQueryClass(null,
				BaseGetPhoneFromWap.class, sb.toString(), args);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}
}
